import BaseController from "../../cfw/mvc/BaseController";
import SDKManager from "../SDKManager";
import ModuleManager, { ModuleID } from "../../cfw/module/ModuleManager";
import GameItemModel from "../base/GameItemModel";
import { UIIndex } from "../../cfw/tools/Define";
export default class RedPacketC extends BaseController {

    private static ins: RedPacketC;

    static instance() {
        if (!this.ins) {
            this.ins = new RedPacketC()
        }
        return this.ins;
    }

    intoLayer() {
        this.pushView('prefabs/redpacket/RedPacketView', 'RedPacketView', SDKManager.getChannel(), ModuleManager.getLoader(ModuleID.PUBLIC))
    }

    clickGameItem(model: GameItemModel) {
        SDKManager.getChannel().toOtherGame(model, (
        ) => {

        })
    }

    showFriend() {
        let flag = SDKManager.getChannel().isSwtichOpen()
        if (flag) {
            this.pushView('prefabs/friend/FriendView', 'FriendView', SDKManager.getChannel(), ModuleManager.getLoader(ModuleID.PUBLIC), UIIndex.TOP)
        }

    }
}
